# 测试用例层
import unittest
import requests
from 其他.fengzhuangmmtjiekou.Tese_demo2 import TestLogin


class TestLogin_testcase(unittest.TestCase):
    session = None

    @classmethod
    def setUpClass(cls) -> None:
        cls.session = requests.session()

    # 登陆成功
    def testcase1(self):
        TestLogin.test01_login_rmd(self.session)
        params1 = {"username": "food",
                   "password": "96e79218965eb72c92a549dd5a330112",
                   "scene": "LOGIN",
                   "captcha": 1111,
                   "uuid": "8e20ddd0-ac16-11ed-9172-39cda48efa3c"}

        resp = TestLogin.test02_login(self.session, params1)
        print(resp.json())
        TestLogin.common_assert(self, resp, 200)

    # 登陆失败
    def testcase2(self):
        TestLogin.test01_login_rmd(self.session)
        params1 = {"username": "food123",
                   "password": "96e79218965eb72c92a549dd5a330112",
                   "scene": "LOGIN",
                   "captcha": 1111,
                   "uuid": "8e20ddd0-ac16-11ed-9172-39cda48efa3c"}

        resp = TestLogin.test02_login(self.session, params1)
        print(resp.json())
        TestLogin.common_assert(self, resp, 500)

    @classmethod
    def tearDownClass(cls) -> None:
        print('teardownclass')
